let routes = new Set();
const getChunks = (modulesContext) => {
    if (!modulesContext || modulesContext.length === 0) {
        return undefined;
    }
    return modulesContext.keys().reduce((modules, key) => {
        modules[key.replace(/(^\.\/)|(\.js$)/g, '')] = modulesContext(key).default
        return modules;
    }, {});
}
// 自动导入路由
const routerContext = require.context('./modules', true, /\.js$/);
const routerChunks = getChunks(routerContext)
Object.keys(routerChunks).forEach((item) => {
    let paths = routerChunks[item];
    Object.keys(paths).forEach(index => {
        routes.add(paths[index]);
    });
})
export default routes;
